/*
 * GerenciarConexoes.java
 *
 * Created on 26/06/2011, 11:13:38
 */
package br.com.nextsql;

import br.com.nextsql.renderizar.OrdenadorProperties;
import br.com.nextsql.renderizar.TabelaModelo;
import br.com.nextsql.renderizar.TabelaRender;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.util.Properties;
import javax.swing.Box;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JSpinner;

/**
 *
 * @author rho
 */
public class GerenciarConexoes extends javax.swing.JDialog {
    private boolean salvar = false;
    private Properties lingua;
    private Properties principal;
    private Properties conexoes[] = GlobalConf.lerConexoes();
    private String tipoConexao[];
    private boolean retorno = false;
    private boolean abrirconexao = true;
    private Properties conexao;
    private String arquivo;
    /** Creates new form GerenciarConexoes */
    public GerenciarConexoes(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        tfPorta.setEditor(new JSpinner.NumberEditor (tfPorta, "###0"));
        traducao();
        listarConexao();
        listarTipoConexao();
    }
    public void atualizarDados(){
        int id = tbConexoes.getSelectedRow();
        if(id >= 0){
            conexao = conexoes[id];
            if(new File(principal.getProperty("file.bancoDir")+conexao.getProperty("Tipo")).exists()){
                Properties prop = new Properties();
                try{
                    FileInputStream file = new FileInputStream(principal.getProperty("file.bancoDir")+conexao.getProperty("Tipo"));
                    prop.load(file);
                    cbTipoConexao.setSelectedItem(prop.getProperty("Nome"));
                    file.close();
                }catch(Exception ex){}
            }
            tfNome.setText(conexao.getProperty("Nome"));
            tfServidor.setText(GlobalConf.descriptografar(conexao.getProperty("Servidor")));
            tfUsuario.setText(GlobalConf.descriptografar(conexao.getProperty("Usuario")));
            tfSenha.setText(GlobalConf.descriptografar(conexao.getProperty("Senha")));
            tfPorta.setValue(Integer.parseInt(GlobalConf.descriptografar(conexao.getProperty("Porta"))));
        }else{
            conexao = null;
        }
    }
    public void listarConexao(){
        String colunas[] = new String[]{"Conexões"};
        TabelaModelo modelo = new TabelaModelo(colunas);
        tbConexoes.setModel(modelo);
        tbConexoes.setDefaultRenderer(JLabel.class, new TabelaRender());
        if(conexoes != null){
            for(Properties c: conexoes){
                JLabel label = new JLabel(c.getProperty("Nome"));
                label.setName(c.getProperty("Arquivo")+"|"+c.getProperty("Tipo"));
                Object[] dados = {label};
                modelo.addRow(dados);
            }
        }else{
            JOptionPane.showMessageDialog(rootPane, "");
        }
    }
    public void listarTipoConexao(){
        principal = GlobalConf.lerPropriedades();
        DefaultComboBoxModel model = new DefaultComboBoxModel();
        cbTipoConexao.setModel(model);
        File dir = new File(principal.getProperty("file.bancoDir"));
        FilenameFilter fileType = new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith(".conf");
            }
        };
        String[] dirFilhos = dir.list(fileType);
        if(dirFilhos != null){
            for(int i=0; i<dirFilhos.length; i++){
                Properties prop = new Properties();
                try{
                    FileInputStream fis = new FileInputStream(principal.getProperty("file.bancoDir")+dirFilhos[i]);
                    prop.load(fis);
                    cbTipoConexao.addItem(prop.getProperty("Nome"));
                }catch(Exception ex){}
            }
            tipoConexao = dirFilhos;
        }
    }
    public void traducao(){
        lingua = GlobalConf.lerLingua();
        setTitle(lingua.getProperty("gerenciarConexoes"));
        txtNomeConexao.setText(lingua.getProperty("nomeConexao")+":");
        txtTipoConexao.setText(lingua.getProperty("tipoConexao")+":");
        txtServidor.setText(lingua.getProperty("servidor")+":");
        txtUsuario.setText(lingua.getProperty("usuario")+":");
        txtPorta.setText(lingua.getProperty("porta")+":");
        txtSenha.setText(lingua.getProperty("senha")+":");
        btNovo.setText(lingua.getProperty("novo"));
        btExcluir.setText(lingua.getProperty("excluir"));
        btSalvar.setText(lingua.getProperty("salvar"));
        btCancelar.setText(lingua.getProperty("cancelar"));
        btSalvarAbrir.setText(lingua.getProperty("salvarAbrir"));
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tbEsquerdo = new javax.swing.JToolBar();
        btNovo = new javax.swing.JButton();
        btSalvar = new javax.swing.JButton();
        btExcluir = new javax.swing.JButton();
        jSplitPane1 = new javax.swing.JSplitPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbConexoes = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        tfPorta = new javax.swing.JSpinner();
        txtPorta = new javax.swing.JLabel();
        tfSenha = new javax.swing.JPasswordField();
        txtSenha = new javax.swing.JLabel();
        tfUsuario = new javax.swing.JTextField();
        txtUsuario = new javax.swing.JLabel();
        tfServidor = new javax.swing.JTextField();
        txtServidor = new javax.swing.JLabel();
        cbTipoConexao = new javax.swing.JComboBox();
        txtTipoConexao = new javax.swing.JLabel();
        tfNome = new javax.swing.JTextField();
        txtNomeConexao = new javax.swing.JLabel();
        tbDireito = new javax.swing.JToolBar();
        btSalvarAbrir = new javax.swing.JButton();
        btCancelar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Nova conexão");
        setIconImage(null);

        tbEsquerdo.setFloatable(false);
        tbEsquerdo.setRollover(true);

        btNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/nextsql/resources/icons/server_add.png"))); // NOI18N
        btNovo.setMnemonic('N');
        btNovo.setText("Novo");
        btNovo.setFocusable(false);
        btNovo.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btNovo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btNovo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btNovoActionPerformed(evt);
            }
        });
        tbEsquerdo.add(btNovo);

        btSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/nextsql/resources/icons/disk.png"))); // NOI18N
        btSalvar.setMnemonic('S');
        btSalvar.setText("Salvar");
        btSalvar.setFocusable(false);
        btSalvar.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btSalvar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarActionPerformed(evt);
            }
        });
        tbEsquerdo.add(btSalvar);

        btExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/nextsql/resources/icons/delete.png"))); // NOI18N
        btExcluir.setMnemonic('E');
        btExcluir.setText("Excluir");
        btExcluir.setFocusable(false);
        btExcluir.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btExcluir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btExcluirActionPerformed(evt);
            }
        });
        tbEsquerdo.add(btExcluir);

        jSplitPane1.setDividerLocation(150);
        jSplitPane1.setDividerSize(2);

        tbConexoes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {}
            },
            new String [] {

            }
        ));
        tbConexoes.setNextFocusableComponent(tfNome);
        tbConexoes.setRowHeight(20);
        tbConexoes.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tbConexoes.setShowHorizontalLines(false);
        tbConexoes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbConexoesMouseClicked(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                tbConexoesMouseReleased(evt);
            }
        });
        tbConexoes.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                tbConexoesFocusGained(evt);
            }
        });
        tbConexoes.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tbConexoesKeyReleased(evt);
            }
        });
        jScrollPane1.setViewportView(tbConexoes);

        jSplitPane1.setLeftComponent(jScrollPane1);

        tfPorta.setValue(5432);

        txtPorta.setText("Porta:");

        txtSenha.setText("Senha:");

        txtUsuario.setText("Usuário:");

        txtServidor.setText("Servidor/IP:");

        txtTipoConexao.setText("Tipo de conexão:");

        txtNomeConexao.setText("Nome da conexão:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtNomeConexao)
                    .addComponent(txtTipoConexao)
                    .addComponent(txtServidor)
                    .addComponent(txtUsuario)
                    .addComponent(txtSenha)
                    .addComponent(txtPorta))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tfServidor, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                    .addComponent(tfUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                    .addComponent(tfSenha, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                    .addComponent(cbTipoConexao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfNome, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                    .addComponent(tfPorta, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNomeConexao)
                    .addComponent(tfNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtTipoConexao)
                    .addComponent(cbTipoConexao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtServidor)
                    .addComponent(tfServidor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtUsuario)
                    .addComponent(tfUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtSenha)
                    .addComponent(tfSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtPorta)
                    .addComponent(tfPorta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jSplitPane1.setRightComponent(jPanel1);

        tbDireito.setFloatable(false);
        tbDireito.setRollover(true);

        btSalvarAbrir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/nextsql/resources/icons/database_save.png"))); // NOI18N
        btSalvarAbrir.setMnemonic('A');
        btSalvarAbrir.setText("Salvar e abrir");
        btSalvarAbrir.setFocusable(false);
        btSalvarAbrir.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btSalvarAbrir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btSalvarAbrir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarAbrirActionPerformed(evt);
            }
        });
        tbDireito.add(btSalvarAbrir);

        btCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/nextsql/resources/icons/cross.png"))); // NOI18N
        btCancelar.setMnemonic('C');
        btCancelar.setText("Cancelar");
        btCancelar.setFocusable(false);
        btCancelar.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btCancelar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelarActionPerformed(evt);
            }
        });
        tbDireito.add(btCancelar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(tbEsquerdo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 118, Short.MAX_VALUE)
                .addComponent(tbDireito, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(tbDireito, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tbEsquerdo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        pack();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension dialogSize = getSize();
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
    }// </editor-fold>//GEN-END:initComponents

    private void btNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btNovoActionPerformed
        conexao = null;
        tfNome.setText(null);
        tfSenha.setText(null);
        tfUsuario.setText(null);
        tfServidor.setText(null);
        tbConexoes.clearSelection();
        tfNome.requestFocus();
    }//GEN-LAST:event_btNovoActionPerformed

    private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
        salvar = true;
        int id = tbConexoes.getSelectedRow();
        if(id >= 0){
            btExcluir.doClick();
        }
        this.arquivo = tfNome.getText()+".con";
        if("".equals(tfNome.getText())){
            JOptionPane.showMessageDialog(rootPane, lingua.getProperty("erroNomeConexao"));
            tfNome.requestFocus();
        }else if(new File(principal.getProperty("file.conexoesDir")+GlobalConf.limparAcentos(this.arquivo)).exists() && conexao == null){
           JOptionPane.showMessageDialog(rootPane, lingua.getProperty("erroExisteConexao"));
        }else{
            conexao = new Properties();
            conexao.setProperty("Nome", tfNome.getText());
            conexao.setProperty("Tipo", tipoConexao[cbTipoConexao.getSelectedIndex()]);
            conexao.setProperty("Servidor", GlobalConf.criptografar(tfServidor.getText()));
            conexao.setProperty("Usuario", GlobalConf.criptografar(tfUsuario.getText()));
            conexao.setProperty("Senha", GlobalConf.criptografar(tfSenha.getText()));
            conexao.setProperty("Porta", GlobalConf.criptografar(String.valueOf(tfPorta.getValue())));
            conexao.setProperty("Arquivo", GlobalConf.limparAcentos(this.arquivo));
            try{
                new OrdenadorProperties().OrdenarProperties(conexao, principal.getProperty("file.conexoesDir")+GlobalConf.limparAcentos(this.arquivo), "Arquivo de conexão:");
            }catch(Exception ex){
                JOptionPane.showMessageDialog(rootPane, lingua.getProperty("erroSalvarConexao")+ex);
            }
            retorno = true;
        }
        conexoes = GlobalConf.lerConexoes();
        listarConexao();
        if(!abrirconexao){
            btNovo.doClick();
        }
        salvar = false;
    }//GEN-LAST:event_btSalvarActionPerformed

    private void tbConexoesKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tbConexoesKeyReleased
        atualizarDados();
    }//GEN-LAST:event_tbConexoesKeyReleased

    private void tbConexoesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbConexoesMouseClicked
        atualizarDados();
    }//GEN-LAST:event_tbConexoesMouseClicked

    private void tbConexoesMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbConexoesMouseReleased
        if (evt.getClickCount() > 1) {
            atualizarDados();
        }
    }//GEN-LAST:event_tbConexoesMouseReleased

    private void tbConexoesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tbConexoesFocusGained
        atualizarDados();
    }//GEN-LAST:event_tbConexoesFocusGained

    private void btExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btExcluirActionPerformed
        int id = tbConexoes.getSelectedRow();
        if(id >= 0){
            Properties arquivo = conexoes[id];
            File file = new File(principal.getProperty("file.conexoesDir")+arquivo.getProperty("Arquivo"));
            conexoes[id] = null;            
            arquivo = null;
            System.gc();
            file.delete();
            System.gc();
        }else{
            JOptionPane.showMessageDialog(rootPane, lingua.getProperty("erroSelecioneConexao"));
        }
        conexoes = GlobalConf.lerConexoes();
        listarConexao();
        retorno = true;
        if(!salvar){
            btNovo.doClick();
        }
    }//GEN-LAST:event_btExcluirActionPerformed

    private void btCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelarActionPerformed
        setVisible(false);
    }//GEN-LAST:event_btCancelarActionPerformed

    private void btSalvarAbrirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarAbrirActionPerformed
        abrirconexao = true;
        btSalvar.doClick();
        if(conexao == null){
            abrirconexao = false;
        }
        btCancelar.doClick();
    }//GEN-LAST:event_btSalvarAbrirActionPerformed
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                GerenciarConexoes dialog = new GerenciarConexoes(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    public String getArquivo() {
        return this.arquivo;
    }
    public Properties getPropriedades(){
        return conexao;
    }
    public boolean isAbrirconexao() {
        return abrirconexao;
    }
    public boolean isRetorno() {
        return retorno;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btCancelar;
    private javax.swing.JButton btExcluir;
    private javax.swing.JButton btNovo;
    private javax.swing.JButton btSalvar;
    private javax.swing.JButton btSalvarAbrir;
    private javax.swing.JComboBox cbTipoConexao;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTable tbConexoes;
    private javax.swing.JToolBar tbDireito;
    private javax.swing.JToolBar tbEsquerdo;
    private javax.swing.JTextField tfNome;
    private javax.swing.JSpinner tfPorta;
    private javax.swing.JPasswordField tfSenha;
    private javax.swing.JTextField tfServidor;
    private javax.swing.JTextField tfUsuario;
    private javax.swing.JLabel txtNomeConexao;
    private javax.swing.JLabel txtPorta;
    private javax.swing.JLabel txtSenha;
    private javax.swing.JLabel txtServidor;
    private javax.swing.JLabel txtTipoConexao;
    private javax.swing.JLabel txtUsuario;
    // End of variables declaration//GEN-END:variables
}
